package Io;

import java.io.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-04-05
 * Time: 16:51
 */
public class test6 {
    public static void main(String[] args) throws IOException {
        try(OutputStream os= new FileOutputStream("Writer.txt")){
            try (OutputStreamWriter osWriter = new OutputStreamWriter(os,"UTF-8")){
                try (PrintWriter writer = new PrintWriter(osWriter)){
                    writer.println("我是第一行");
                    writer.print("我的第二行\r\n");
                    writer.printf("%d: 我的第三行\r\n", 1 + 1);
                    writer.flush();
                }
            }
        }
    }
}
